﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// RequestQuery 的摘要说明
/// </summary>
public class RequestQuery
{
    public RequestQuery()
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //
    }
    /// <summary>
    /// 获取inforation信息
    /// </summary>
    /// <param name="row">行数</param>
    /// <param name="nkey">nKey</param>
    /// <param name="strlen">字符数</param>
    /// <returns></returns>
    public static string GetInforamtion(int row,int nkey,int strlen)
    {
        BLL.Information infor=new BLL.Information();
        DataView dv = infor.FindAll(nkey).Tables[0].DefaultView;

        if (dv.Table.Rows.Count < row) row = dv.Table.Rows.Count;
        StringBuilder sbstring = new StringBuilder();
        //<tr>
        //              <td width="6%"><img src="images/icon.gif" width="7" height="7" /></td>
        //              <td width="94%" class="STYLE1"><a href="#">齐白石徒子徒孙2008年的是是非非</a> </td>
        //              </tr>
        foreach (DataRowView drv in dv)
        {
            string href=drv["sLink"].ToString();
            href=(href==""?"newsDelail.aspx":href);
            sbstring.Append("<tr width=\"6%\"><img src=\"images/icon.gif\" width=\"7\" height=\"7\"/></td>");
            sbstring.AppendFormat("<td width=\"94%\" class=\"style1\"><a href=\"{0}\">{1}</a></td>", J.Comm.Text.GetStringLength(drv["sTitle"].ToString(), 15));
            sbstring.Append("</tr");
        }
        return sbstring.ToString();
    }
}
